<div class="col-xs-12 col-md-3 col-sm-6 product-col">
	<div class="product-image-wrapper">
		<div class="single-products">
			<div class="productinfo text-center">
				<p class="product-item-wrap">
                    <a href="<?php echo product_url($p->slug); ?>" title="<?php echo $p->title; ?>">
                        <img class="media-object inline product-item lazy" src="<?php echo assets('images/blank.gif', true); ?>" data-src="<?php echo product_upload($p->image, $p->shop_image_folder); ?>" alt="<?php echo $p->title; ?>" />
                    </a>
                    <?php
                    if(property_exists($p, 'sale_flg') && $p->sale_flg==ON && $p->price_new < $p->price_old) {
                        $per = 100 - round($p->price_new / $p->price_old * 100);
                        if($per > 0){
                            //echo '<span class="sale-percent">'.$per.'%</span>';
                        }
                    }
                    ?>
                </p>
                <div class="product-info-wrap">
                    <p class="text-upper">
                        <a class="item-title product-title" href="<?php echo product_url($p->slug); ?>" title="<?php echo $p->title; ?>">
                            <?php echo strlen($p->title)>17? substr($p->title, 0, 17).'...':$p->title; ?>
                        </a>
                    </p>
                    <h2 class="clear-mgt"><?php echo currency_format($p->price_new); ?></h2>
                    <?php if(property_exists($p, 'sale_flg') && $p->sale_flg==ON) { ?>
                    <h5 class="price-old"><?php echo currency_format($p->price_old); ?></h5>
                    <?php } else { ?>
                    <h5>&nbsp;</h5>
                    <?php } ?>
                </div>
                <p class="product-info-ctrl clear-mgr">
                    <a title="Cho vào gỉỏ hàng" class="btn btn-default btn-left add-to-cart btn-add-to-cart clear-mgr mgbt5" data-id="<?php echo $p->detail_id; ?>" href="#" data-href="<?php echo page_url('cart/list-push'); ?>">
                        <i class="fa fa-shopping-cart"></i>Mua
                    </a>
                    <a title="Chi tiết" href="<?php echo product_url($p->slug); ?>" class="btn btn-default btn-right add-to-cart clear-mgr mgbt5">
                        <i class="glyphicon glyphicon-share-alt"></i>
                    </a>
                </p>
            </div>
            <?php if(property_exists($p, 'product_new') && $p->product_new == ON) { ?>
            <img src="<?php echo assets('images/new.png'); ?>" class="new" alt="Sản phẩm mới"/>
            <?php } else if(property_exists($p, 'sale_flg') && $p->sale_flg==ON) { ?>
            <img src="<?php echo assets('images/sale.png'); ?>" class="new" alt="Đang giảm giá"/>
            <?php } ?>
        </div>
    </div>
</div>